package com.hs.mod_archive.fragment

import android.os.Bundle
import android.view.View
import androidx.navigation.Navigation.findNavController
import com.hs.framework.base.BaseDataBindFragment
import com.hs.mod_archive.R
import com.hs.mod_archive.databinding.FragmentDeviceManagerBinding

class FragmentDeviceManager : BaseDataBindFragment<FragmentDeviceManagerBinding>() {
    override fun initView(view: View, savedInstanceState: Bundle?) {
        mBinding!!.btList.setOnCheckedChangeListener { _, checkedId ->
            if (checkedId == R.id.cabinetConfig) {
                findNavController(mBinding!!.navDeviceConfig)
                    .navigate(R.id.FragmentDevCabinetConfig, Bundle())
            } else if (checkedId == R.id.readerConfig) {
                findNavController(mBinding!!.navDeviceConfig)
                    .navigate(R.id.FragmentDevReaderConfig, Bundle())
            } else if (checkedId == R.id.otherConfig) {
                findNavController(mBinding!!.navDeviceConfig)
                    .navigate(R.id.FragmentDevOtherConfig, Bundle())
            }
        }
    }
}
